const path = require('path');
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');

const commonWebpack = require('./webpack.common')

module.exports = merge(commonWebpack, {
  mode: 'development',
  devtool: 'source-map',
  devServer: {
    contentBase: path.join(__dirname, '/'),
    hot: true,
    host: 'localhost',
    port: 8080,
    open: false,
    // publicPath: '/'
  },
  plugins: [
    new webpack.DefinePlugin({
      BASE_URL: "'./'",
      'process.env': "'development'"
    }), 
    new HtmlWebpackPlugin({
      template: './public/index.html',
      title: 'test',
      minify: true
    }),
    new VueLoaderPlugin(),
    new webpack.HotModuleReplacementPlugin()
  ]
});